package WWW.SST.LIB;

/** 
 Term ��ժҪ˵����
*/
public class Term
{
	public Term()
	{
		//
		// TODO: �ڴ˴���ӹ��캯���߼�
		//
	}

	public static String NewstTermBingoNo()
	{
		String s = "select top 1 * from qishu where kaij<>''  ORDER BY qihao DESC";
		 DataTable d = MOLE.SQL.GetDataTable(s);
		if (d.Rows.size() == 0)
		{
			return "";
		}
		else
		{
			 return d.Rows[0]["qihao"].toString();
		}




	}

		 public static String TermModif(String term)
		 {

			try
			{
				String s = term;
				String sx = "";
				//**************
				String date = s.substring(0,9);
				String intterm = s.substring(9, 11);
				if (intterm.equals("01"))
				{
					return s;
				}


				int m = java.time.LocalDateTime.now().getMinute() % 10;
				int sec = java.time.LocalDateTime.now().getSecond();
				if ((m == 8 && sec < 30))
				{
					String inttermX = (Integer.parseInt(intterm) - 1).toString();
					if (inttermX.length() == 1)
					{
						sx = date + "0" + intterm;
					}
					else
					{
						sx = date + inttermX;
					}
				}
				else
				{
					sx = s;
				}
				//************
				return sx;
			}
			catch (RuntimeException ee)
			{
					return term;
			}

		 }
}